/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-04-02
 * Time: 18:57
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();
        BinaryTree.TNode root = tree.CreateNode();

        System.out.print("前序遍历1: ");
        tree.preOrder(root);
        System.out.println();
        System.out.print("前序遍历2: ");
        tree.preOrderNot(root);
        System.out.println();

        System.out.print("中序遍历1: ");
        tree.inOrder(root);
        System.out.println();
        System.out.print("中序遍历2: ");
        tree.inOrderNot(root);
        System.out.println();


        System.out.print("后序遍历1: ");
        tree.postOrder(root);
        System.out.println();
        System.out.print("后序遍历2: ");
        tree.postOrderNot(root);
        System.out.println();

        System.out.println("=====根结点======");
        System.out.println(tree.Size(root));
        System.out.println("=====叶子结点=====");
        System.out.println(tree.getLeafNodeCount(root));
        System.out.println("=====查找=====");
        System.out.println(tree.find(root,'D').val);
    }
}
